Termination w.r.t. Q of the following Term Rewriting System could not be shown:

Q restricted rewrite system:
The TRS R consists of the following rules:

app(app(app(sort, f), g), nil) → nil
app(app(app(sort, f), g), app(app(cons, x), y)) → app(app(app(app(insert, f), g), app(app(app(sort, f), g), y)), x)
app(app(app(app(insert, f), g), nil), y) → app(app(cons, y), nil)
app(app(app(app(insert, f), g), app(app(cons, x), z)), y) → app(app(cons, app(app(f, x), y)), app(app(app(app(insert, f), g), z), app(app(g, x), y)))
app(app(max, 0), y) → y
app(app(max, x), 0) → x
app(app(max, app(s, x)), app(s, y)) → app(app(max, x), y)
app(app(min, 0), y) → 0
app(app(min, x), 0) → 0
app(app(min, app(s, x)), app(s, y)) → app(app(min, x), y)
app(asort, z) → app(app(app(sort, min), max), z)
app(dsort, z) → app(app(app(sort, max), min), z)

Q is empty.


QTRS
  ↳ Overlay + Local Confluence

Q restricted rewrite system:
The TRS R consists of the following rules:

app(app(app(sort, f), g), nil) → nil
app(app(app(sort, f), g), app(app(cons, x), y)) → app(app(app(app(insert, f), g), app(app(app(sort, f), g), y)), x)
app(app(app(app(insert, f), g), nil), y) → app(app(cons, y), nil)
app(app(app(app(insert, f), g), app(app(cons, x), z)), y) → app(app(cons, app(app(f, x), y)), app(app(app(app(insert, f), g), z), app(app(g, x), y)))
app(app(max, 0), y) → y
app(app(max, x), 0) → x
app(app(max, app(s, x)), app(s, y)) → app(app(max, x), y)
app(app(min, 0), y) → 0
app(app(min, x), 0) → 0
app(app(min, app(s, x)), app(s, y)) → app(app(min, x), y)
app(asort, z) → app(app(app(sort, min), max), z)
app(dsort, z) → app(app(app(sort, max), min), z)

Q is empty.

The TRS is overlay and locally confluent. By [19] we can switch to innermost.

↳ QTRS
  ↳ Overlay + Local Confluence
QTRS
      ↳ DependencyPairsProof

Q restricted rewrite system:
The TRS R consists of the following rules:

app(app(app(sort, f), g), nil) → nil
app(app(app(sort, f), g), app(app(cons, x), y)) → app(app(app(app(insert, f), g), app(app(app(sort, f), g), y)), x)
app(app(app(app(insert, f), g), nil), y) → app(app(cons, y), nil)
app(app(app(app(insert, f), g), app(app(cons, x), z)), y) → app(app(cons, app(app(f, x), y)), app(app(app(app(insert, f), g), z), app(app(g, x), y)))
app(app(max, 0), y) → y
app(app(max, x), 0) → x
app(app(max, app(s, x)), app(s, y)) → app(app(max, x), y)
app(app(min, 0), y) → 0
app(app(min, x), 0) → 0
app(app(min, app(s, x)), app(s, y)) → app(app(min, x), y)
app(asort, z) → app(app(app(sort, min), max), z)
app(dsort, z) → app(app(app(sort, max), min), z)

The set Q consists of the following terms:

app(app(app(sort, x0), x1), nil)
app(app(app(sort, x0), x1), app(app(cons, x2), x3))
app(app(app(app(insert, x0), x1), nil), x2)
app(app(app(app(insert, x0), x1), app(app(cons, x2), x3)), x4)
app(app(max, 0), x0)
app(app(max, x0), 0)
app(app(max, app(s, x0)), app(s, x1))
app(app(min, 0), x0)
app(app(min, x0), 0)
app(app(min, app(s, x0)), app(s, x1))
app(asort, x0)
app(dsort, x0)


Using Dependency Pairs [1,15] we result in the following initial DP problem:
Q DP problem:
The TRS P consists of the following rules:

APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) → APP(g, x)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) → APP(app(app(app(insert, f), g), z), app(app(g, x), y))
APP(app(min, app(s, x)), app(s, y)) → APP(app(min, x), y)
APP(asort, z) → APP(app(sort, min), max)
APP(app(min, app(s, x)), app(s, y)) → APP(min, x)
APP(dsort, z) → APP(app(sort, max), min)
APP(app(app(app(insert, f), g), nil), y) → APP(app(cons, y), nil)
APP(asort, z) → APP(app(app(sort, min), max), z)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) → APP(app(cons, app(app(f, x), y)), app(app(app(app(insert, f), g), z), app(app(g, x), y)))
APP(app(app(sort, f), g), app(app(cons, x), y)) → APP(app(insert, f), g)
APP(app(app(sort, f), g), app(app(cons, x), y)) → APP(app(app(app(insert, f), g), app(app(app(sort, f), g), y)), x)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) → APP(app(app(insert, f), g), z)
APP(app(app(sort, f), g), app(app(cons, x), y)) → APP(app(app(insert, f), g), app(app(app(sort, f), g), y))
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) → APP(app(g, x), y)
APP(app(max, app(s, x)), app(s, y)) → APP(max, x)
APP(app(app(sort, f), g), app(app(cons, x), y)) → APP(insert, f)
APP(app(app(app(insert, f), g), nil), y) → APP(cons, y)
APP(asort, z) → APP(sort, min)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) → APP(f, x)
APP(dsort, z) → APP(app(app(sort, max), min), z)
APP(app(max, app(s, x)), app(s, y)) → APP(app(max, x), y)
APP(app(app(sort, f), g), app(app(cons, x), y)) → APP(app(app(sort, f), g), y)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) → APP(cons, app(app(f, x), y))
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) → APP(app(f, x), y)
APP(dsort, z) → APP(sort, max)

The TRS R consists of the following rules:

app(app(app(sort, f), g), nil) → nil
app(app(app(sort, f), g), app(app(cons, x), y)) → app(app(app(app(insert, f), g), app(app(app(sort, f), g), y)), x)
app(app(app(app(insert, f), g), nil), y) → app(app(cons, y), nil)
app(app(app(app(insert, f), g), app(app(cons, x), z)), y) → app(app(cons, app(app(f, x), y)), app(app(app(app(insert, f), g), z), app(app(g, x), y)))
app(app(max, 0), y) → y
app(app(max, x), 0) → x
app(app(max, app(s, x)), app(s, y)) → app(app(max, x), y)
app(app(min, 0), y) → 0
app(app(min, x), 0) → 0
app(app(min, app(s, x)), app(s, y)) → app(app(min, x), y)
app(asort, z) → app(app(app(sort, min), max), z)
app(dsort, z) → app(app(app(sort, max), min), z)

The set Q consists of the following terms:

app(app(app(sort, x0), x1), nil)
app(app(app(sort, x0), x1), app(app(cons, x2), x3))
app(app(app(app(insert, x0), x1), nil), x2)
app(app(app(app(insert, x0), x1), app(app(cons, x2), x3)), x4)
app(app(max, 0), x0)
app(app(max, x0), 0)
app(app(max, app(s, x0)), app(s, x1))
app(app(min, 0), x0)
app(app(min, x0), 0)
app(app(min, app(s, x0)), app(s, x1))
app(asort, x0)
app(dsort, x0)

We have to consider all minimal (P,Q,R)-chains.

↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
QDP
          ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) → APP(g, x)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) → APP(app(app(app(insert, f), g), z), app(app(g, x), y))
APP(app(min, app(s, x)), app(s, y)) → APP(app(min, x), y)
APP(asort, z) → APP(app(sort, min), max)
APP(app(min, app(s, x)), app(s, y)) → APP(min, x)
APP(dsort, z) → APP(app(sort, max), min)
APP(app(app(app(insert, f), g), nil), y) → APP(app(cons, y), nil)
APP(asort, z) → APP(app(app(sort, min), max), z)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) → APP(app(cons, app(app(f, x), y)), app(app(app(app(insert, f), g), z), app(app(g, x), y)))
APP(app(app(sort, f), g), app(app(cons, x), y)) → APP(app(insert, f), g)
APP(app(app(sort, f), g), app(app(cons, x), y)) → APP(app(app(app(insert, f), g), app(app(app(sort, f), g), y)), x)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) → APP(app(app(insert, f), g), z)
APP(app(app(sort, f), g), app(app(cons, x), y)) → APP(app(app(insert, f), g), app(app(app(sort, f), g), y))
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) → APP(app(g, x), y)
APP(app(max, app(s, x)), app(s, y)) → APP(max, x)
APP(app(app(sort, f), g), app(app(cons, x), y)) → APP(insert, f)
APP(app(app(app(insert, f), g), nil), y) → APP(cons, y)
APP(asort, z) → APP(sort, min)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) → APP(f, x)
APP(dsort, z) → APP(app(app(sort, max), min), z)
APP(app(max, app(s, x)), app(s, y)) → APP(app(max, x), y)
APP(app(app(sort, f), g), app(app(cons, x), y)) → APP(app(app(sort, f), g), y)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) → APP(cons, app(app(f, x), y))
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) → APP(app(f, x), y)
APP(dsort, z) → APP(sort, max)

The TRS R consists of the following rules:

app(app(app(sort, f), g), nil) → nil
app(app(app(sort, f), g), app(app(cons, x), y)) → app(app(app(app(insert, f), g), app(app(app(sort, f), g), y)), x)
app(app(app(app(insert, f), g), nil), y) → app(app(cons, y), nil)
app(app(app(app(insert, f), g), app(app(cons, x), z)), y) → app(app(cons, app(app(f, x), y)), app(app(app(app(insert, f), g), z), app(app(g, x), y)))
app(app(max, 0), y) → y
app(app(max, x), 0) → x
app(app(max, app(s, x)), app(s, y)) → app(app(max, x), y)
app(app(min, 0), y) → 0
app(app(min, x), 0) → 0
app(app(min, app(s, x)), app(s, y)) → app(app(min, x), y)
app(asort, z) → app(app(app(sort, min), max), z)
app(dsort, z) → app(app(app(sort, max), min), z)

The set Q consists of the following terms:

app(app(app(sort, x0), x1), nil)
app(app(app(sort, x0), x1), app(app(cons, x2), x3))
app(app(app(app(insert, x0), x1), nil), x2)
app(app(app(app(insert, x0), x1), app(app(cons, x2), x3)), x4)
app(app(max, 0), x0)
app(app(max, x0), 0)
app(app(max, app(s, x0)), app(s, x1))
app(app(min, 0), x0)
app(app(min, x0), 0)
app(app(min, app(s, x0)), app(s, x1))
app(asort, x0)
app(dsort, x0)

We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 3 SCCs with 14 less nodes.

↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
QDP
                ↳ UsableRulesProof
              ↳ QDP
              ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

APP(app(min, app(s, x)), app(s, y)) → APP(app(min, x), y)

The TRS R consists of the following rules:

app(app(app(sort, f), g), nil) → nil
app(app(app(sort, f), g), app(app(cons, x), y)) → app(app(app(app(insert, f), g), app(app(app(sort, f), g), y)), x)
app(app(app(app(insert, f), g), nil), y) → app(app(cons, y), nil)
app(app(app(app(insert, f), g), app(app(cons, x), z)), y) → app(app(cons, app(app(f, x), y)), app(app(app(app(insert, f), g), z), app(app(g, x), y)))
app(app(max, 0), y) → y
app(app(max, x), 0) → x
app(app(max, app(s, x)), app(s, y)) → app(app(max, x), y)
app(app(min, 0), y) → 0
app(app(min, x), 0) → 0
app(app(min, app(s, x)), app(s, y)) → app(app(min, x), y)
app(asort, z) → app(app(app(sort, min), max), z)
app(dsort, z) → app(app(app(sort, max), min), z)

The set Q consists of the following terms:

app(app(app(sort, x0), x1), nil)
app(app(app(sort, x0), x1), app(app(cons, x2), x3))
app(app(app(app(insert, x0), x1), nil), x2)
app(app(app(app(insert, x0), x1), app(app(cons, x2), x3)), x4)
app(app(max, 0), x0)
app(app(max, x0), 0)
app(app(max, app(s, x0)), app(s, x1))
app(app(min, 0), x0)
app(app(min, x0), 0)
app(app(min, app(s, x0)), app(s, x1))
app(asort, x0)
app(dsort, x0)

We have to consider all minimal (P,Q,R)-chains.
As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [15] we can delete all non-usable rules [17] from R.

↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
                ↳ UsableRulesProof
QDP
                    ↳ ATransformationProof
              ↳ QDP
              ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

APP(app(min, app(s, x)), app(s, y)) → APP(app(min, x), y)

R is empty.
The set Q consists of the following terms:

app(app(app(sort, x0), x1), nil)
app(app(app(sort, x0), x1), app(app(cons, x2), x3))
app(app(app(app(insert, x0), x1), nil), x2)
app(app(app(app(insert, x0), x1), app(app(cons, x2), x3)), x4)
app(app(max, 0), x0)
app(app(max, x0), 0)
app(app(max, app(s, x0)), app(s, x1))
app(app(min, 0), x0)
app(app(min, x0), 0)
app(app(min, app(s, x0)), app(s, x1))
app(asort, x0)
app(dsort, x0)

We have to consider all minimal (P,Q,R)-chains.
We have applied the A-Transformation [17] to get from an applicative problem to a standard problem.

↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
                ↳ UsableRulesProof
                  ↳ QDP
                    ↳ ATransformationProof
QDP
                        ↳ QReductionProof
              ↳ QDP
              ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

min1(s(x), s(y)) → min1(x, y)

R is empty.
The set Q consists of the following terms:

sort(x0, x1, nil)
sort(x0, x1, cons(x2, x3))
insert(x0, x1, nil, x2)
insert(x0, x1, cons(x2, x3), x4)
max(0, x0)
max(x0, 0)
max(s(x0), s(x1))
min(0, x0)
min(x0, 0)
min(s(x0), s(x1))
asort(x0)
dsort(x0)

We have to consider all minimal (P,Q,R)-chains.
We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.

sort(x0, x1, nil)
sort(x0, x1, cons(x2, x3))
insert(x0, x1, nil, x2)
insert(x0, x1, cons(x2, x3), x4)
max(0, x0)
max(x0, 0)
max(s(x0), s(x1))
min(0, x0)
min(x0, 0)
min(s(x0), s(x1))
asort(x0)
dsort(x0)



↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
                ↳ UsableRulesProof
                  ↳ QDP
                    ↳ ATransformationProof
                      ↳ QDP
                        ↳ QReductionProof
QDP
                            ↳ QDPSizeChangeProof
              ↳ QDP
              ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

min1(s(x), s(y)) → min1(x, y)

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
QDP
                ↳ UsableRulesProof
              ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

APP(app(max, app(s, x)), app(s, y)) → APP(app(max, x), y)

The TRS R consists of the following rules:

app(app(app(sort, f), g), nil) → nil
app(app(app(sort, f), g), app(app(cons, x), y)) → app(app(app(app(insert, f), g), app(app(app(sort, f), g), y)), x)
app(app(app(app(insert, f), g), nil), y) → app(app(cons, y), nil)
app(app(app(app(insert, f), g), app(app(cons, x), z)), y) → app(app(cons, app(app(f, x), y)), app(app(app(app(insert, f), g), z), app(app(g, x), y)))
app(app(max, 0), y) → y
app(app(max, x), 0) → x
app(app(max, app(s, x)), app(s, y)) → app(app(max, x), y)
app(app(min, 0), y) → 0
app(app(min, x), 0) → 0
app(app(min, app(s, x)), app(s, y)) → app(app(min, x), y)
app(asort, z) → app(app(app(sort, min), max), z)
app(dsort, z) → app(app(app(sort, max), min), z)

The set Q consists of the following terms:

app(app(app(sort, x0), x1), nil)
app(app(app(sort, x0), x1), app(app(cons, x2), x3))
app(app(app(app(insert, x0), x1), nil), x2)
app(app(app(app(insert, x0), x1), app(app(cons, x2), x3)), x4)
app(app(max, 0), x0)
app(app(max, x0), 0)
app(app(max, app(s, x0)), app(s, x1))
app(app(min, 0), x0)
app(app(min, x0), 0)
app(app(min, app(s, x0)), app(s, x1))
app(asort, x0)
app(dsort, x0)

We have to consider all minimal (P,Q,R)-chains.
As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [15] we can delete all non-usable rules [17] from R.

↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
                ↳ UsableRulesProof
QDP
                    ↳ ATransformationProof
              ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

APP(app(max, app(s, x)), app(s, y)) → APP(app(max, x), y)

R is empty.
The set Q consists of the following terms:

app(app(app(sort, x0), x1), nil)
app(app(app(sort, x0), x1), app(app(cons, x2), x3))
app(app(app(app(insert, x0), x1), nil), x2)
app(app(app(app(insert, x0), x1), app(app(cons, x2), x3)), x4)
app(app(max, 0), x0)
app(app(max, x0), 0)
app(app(max, app(s, x0)), app(s, x1))
app(app(min, 0), x0)
app(app(min, x0), 0)
app(app(min, app(s, x0)), app(s, x1))
app(asort, x0)
app(dsort, x0)

We have to consider all minimal (P,Q,R)-chains.
We have applied the A-Transformation [17] to get from an applicative problem to a standard problem.

↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
                ↳ UsableRulesProof
                  ↳ QDP
                    ↳ ATransformationProof
QDP
                        ↳ QReductionProof
              ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

max1(s(x), s(y)) → max1(x, y)

R is empty.
The set Q consists of the following terms:

sort(x0, x1, nil)
sort(x0, x1, cons(x2, x3))
insert(x0, x1, nil, x2)
insert(x0, x1, cons(x2, x3), x4)
max(0, x0)
max(x0, 0)
max(s(x0), s(x1))
min(0, x0)
min(x0, 0)
min(s(x0), s(x1))
asort(x0)
dsort(x0)

We have to consider all minimal (P,Q,R)-chains.
We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.

sort(x0, x1, nil)
sort(x0, x1, cons(x2, x3))
insert(x0, x1, nil, x2)
insert(x0, x1, cons(x2, x3), x4)
max(0, x0)
max(x0, 0)
max(s(x0), s(x1))
min(0, x0)
min(x0, 0)
min(s(x0), s(x1))
asort(x0)
dsort(x0)



↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
                ↳ UsableRulesProof
                  ↳ QDP
                    ↳ ATransformationProof
                      ↳ QDP
                        ↳ QReductionProof
QDP
                            ↳ QDPSizeChangeProof
              ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

max1(s(x), s(y)) → max1(x, y)

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
QDP
                ↳ Narrowing

Q DP problem:
The TRS P consists of the following rules:

APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) → APP(g, x)
APP(dsort, z) → APP(app(app(sort, max), min), z)
APP(app(app(sort, f), g), app(app(cons, x), y)) → APP(app(app(sort, f), g), y)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) → APP(app(app(app(insert, f), g), z), app(app(g, x), y))
APP(app(app(sort, f), g), app(app(cons, x), y)) → APP(app(app(app(insert, f), g), app(app(app(sort, f), g), y)), x)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) → APP(app(g, x), y)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) → APP(app(f, x), y)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) → APP(f, x)
APP(asort, z) → APP(app(app(sort, min), max), z)

The TRS R consists of the following rules:

app(app(app(sort, f), g), nil) → nil
app(app(app(sort, f), g), app(app(cons, x), y)) → app(app(app(app(insert, f), g), app(app(app(sort, f), g), y)), x)
app(app(app(app(insert, f), g), nil), y) → app(app(cons, y), nil)
app(app(app(app(insert, f), g), app(app(cons, x), z)), y) → app(app(cons, app(app(f, x), y)), app(app(app(app(insert, f), g), z), app(app(g, x), y)))
app(app(max, 0), y) → y
app(app(max, x), 0) → x
app(app(max, app(s, x)), app(s, y)) → app(app(max, x), y)
app(app(min, 0), y) → 0
app(app(min, x), 0) → 0
app(app(min, app(s, x)), app(s, y)) → app(app(min, x), y)
app(asort, z) → app(app(app(sort, min), max), z)
app(dsort, z) → app(app(app(sort, max), min), z)

The set Q consists of the following terms:

app(app(app(sort, x0), x1), nil)
app(app(app(sort, x0), x1), app(app(cons, x2), x3))
app(app(app(app(insert, x0), x1), nil), x2)
app(app(app(app(insert, x0), x1), app(app(cons, x2), x3)), x4)
app(app(max, 0), x0)
app(app(max, x0), 0)
app(app(max, app(s, x0)), app(s, x1))
app(app(min, 0), x0)
app(app(min, x0), 0)
app(app(min, app(s, x0)), app(s, x1))
app(asort, x0)
app(dsort, x0)

We have to consider all minimal (P,Q,R)-chains.
By narrowing [15] the rule APP(app(app(sort, f), g), app(app(cons, x), y)) → APP(app(app(app(insert, f), g), app(app(app(sort, f), g), y)), x) at position [0,1] we obtained the following new rules:

APP(app(app(sort, x0), x1), app(app(cons, y2), app(app(cons, x2), x3))) → APP(app(app(app(insert, x0), x1), app(app(app(app(insert, x0), x1), app(app(app(sort, x0), x1), x3)), x2)), y2)
APP(app(app(sort, x0), x1), app(app(cons, y2), nil)) → APP(app(app(app(insert, x0), x1), nil), y2)



↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
              ↳ QDP
                ↳ Narrowing
QDP
                    ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

APP(app(app(sort, x0), x1), app(app(cons, y2), app(app(cons, x2), x3))) → APP(app(app(app(insert, x0), x1), app(app(app(app(insert, x0), x1), app(app(app(sort, x0), x1), x3)), x2)), y2)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) → APP(g, x)
APP(dsort, z) → APP(app(app(sort, max), min), z)
APP(app(app(sort, f), g), app(app(cons, x), y)) → APP(app(app(sort, f), g), y)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) → APP(app(app(app(insert, f), g), z), app(app(g, x), y))
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) → APP(app(f, x), y)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) → APP(app(g, x), y)
APP(app(app(sort, x0), x1), app(app(cons, y2), nil)) → APP(app(app(app(insert, x0), x1), nil), y2)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) → APP(f, x)
APP(asort, z) → APP(app(app(sort, min), max), z)

The TRS R consists of the following rules:

app(app(app(sort, f), g), nil) → nil
app(app(app(sort, f), g), app(app(cons, x), y)) → app(app(app(app(insert, f), g), app(app(app(sort, f), g), y)), x)
app(app(app(app(insert, f), g), nil), y) → app(app(cons, y), nil)
app(app(app(app(insert, f), g), app(app(cons, x), z)), y) → app(app(cons, app(app(f, x), y)), app(app(app(app(insert, f), g), z), app(app(g, x), y)))
app(app(max, 0), y) → y
app(app(max, x), 0) → x
app(app(max, app(s, x)), app(s, y)) → app(app(max, x), y)
app(app(min, 0), y) → 0
app(app(min, x), 0) → 0
app(app(min, app(s, x)), app(s, y)) → app(app(min, x), y)
app(asort, z) → app(app(app(sort, min), max), z)
app(dsort, z) → app(app(app(sort, max), min), z)

The set Q consists of the following terms:

app(app(app(sort, x0), x1), nil)
app(app(app(sort, x0), x1), app(app(cons, x2), x3))
app(app(app(app(insert, x0), x1), nil), x2)
app(app(app(app(insert, x0), x1), app(app(cons, x2), x3)), x4)
app(app(max, 0), x0)
app(app(max, x0), 0)
app(app(max, app(s, x0)), app(s, x1))
app(app(min, 0), x0)
app(app(min, x0), 0)
app(app(min, app(s, x0)), app(s, x1))
app(asort, x0)
app(dsort, x0)

We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 1 SCC with 1 less node.

↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
              ↳ QDP
                ↳ Narrowing
                  ↳ QDP
                    ↳ DependencyGraphProof
QDP
                        ↳ ForwardInstantiation

Q DP problem:
The TRS P consists of the following rules:

APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) → APP(g, x)
APP(app(app(sort, x0), x1), app(app(cons, y2), app(app(cons, x2), x3))) → APP(app(app(app(insert, x0), x1), app(app(app(app(insert, x0), x1), app(app(app(sort, x0), x1), x3)), x2)), y2)
APP(dsort, z) → APP(app(app(sort, max), min), z)
APP(app(app(sort, f), g), app(app(cons, x), y)) → APP(app(app(sort, f), g), y)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) → APP(app(app(app(insert, f), g), z), app(app(g, x), y))
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) → APP(app(g, x), y)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) → APP(app(f, x), y)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) → APP(f, x)
APP(asort, z) → APP(app(app(sort, min), max), z)

The TRS R consists of the following rules:

app(app(app(sort, f), g), nil) → nil
app(app(app(sort, f), g), app(app(cons, x), y)) → app(app(app(app(insert, f), g), app(app(app(sort, f), g), y)), x)
app(app(app(app(insert, f), g), nil), y) → app(app(cons, y), nil)
app(app(app(app(insert, f), g), app(app(cons, x), z)), y) → app(app(cons, app(app(f, x), y)), app(app(app(app(insert, f), g), z), app(app(g, x), y)))
app(app(max, 0), y) → y
app(app(max, x), 0) → x
app(app(max, app(s, x)), app(s, y)) → app(app(max, x), y)
app(app(min, 0), y) → 0
app(app(min, x), 0) → 0
app(app(min, app(s, x)), app(s, y)) → app(app(min, x), y)
app(asort, z) → app(app(app(sort, min), max), z)
app(dsort, z) → app(app(app(sort, max), min), z)

The set Q consists of the following terms:

app(app(app(sort, x0), x1), nil)
app(app(app(sort, x0), x1), app(app(cons, x2), x3))
app(app(app(app(insert, x0), x1), nil), x2)
app(app(app(app(insert, x0), x1), app(app(cons, x2), x3)), x4)
app(app(max, 0), x0)
app(app(max, x0), 0)
app(app(max, app(s, x0)), app(s, x1))
app(app(min, 0), x0)
app(app(min, x0), 0)
app(app(min, app(s, x0)), app(s, x1))
app(asort, x0)
app(dsort, x0)

We have to consider all minimal (P,Q,R)-chains.
By forward instantiating [14] the rule APP(app(app(sort, f), g), app(app(cons, x), y)) → APP(app(app(sort, f), g), y) we obtained the following new rules:

APP(app(app(sort, x0), x1), app(app(cons, x2), app(app(cons, y_2), app(app(cons, y_3), y_4)))) → APP(app(app(sort, x0), x1), app(app(cons, y_2), app(app(cons, y_3), y_4)))
APP(app(app(sort, x0), x1), app(app(cons, x2), app(app(cons, y_2), y_3))) → APP(app(app(sort, x0), x1), app(app(cons, y_2), y_3))



↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
              ↳ QDP
                ↳ Narrowing
                  ↳ QDP
                    ↳ DependencyGraphProof
                      ↳ QDP
                        ↳ ForwardInstantiation
QDP
                            ↳ ForwardInstantiation

Q DP problem:
The TRS P consists of the following rules:

APP(app(app(sort, x0), x1), app(app(cons, y2), app(app(cons, x2), x3))) → APP(app(app(app(insert, x0), x1), app(app(app(app(insert, x0), x1), app(app(app(sort, x0), x1), x3)), x2)), y2)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) → APP(g, x)
APP(dsort, z) → APP(app(app(sort, max), min), z)
APP(app(app(sort, x0), x1), app(app(cons, x2), app(app(cons, y_2), app(app(cons, y_3), y_4)))) → APP(app(app(sort, x0), x1), app(app(cons, y_2), app(app(cons, y_3), y_4)))
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) → APP(app(app(app(insert, f), g), z), app(app(g, x), y))
APP(app(app(sort, x0), x1), app(app(cons, x2), app(app(cons, y_2), y_3))) → APP(app(app(sort, x0), x1), app(app(cons, y_2), y_3))
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) → APP(app(f, x), y)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) → APP(app(g, x), y)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) → APP(f, x)
APP(asort, z) → APP(app(app(sort, min), max), z)

The TRS R consists of the following rules:

app(app(app(sort, f), g), nil) → nil
app(app(app(sort, f), g), app(app(cons, x), y)) → app(app(app(app(insert, f), g), app(app(app(sort, f), g), y)), x)
app(app(app(app(insert, f), g), nil), y) → app(app(cons, y), nil)
app(app(app(app(insert, f), g), app(app(cons, x), z)), y) → app(app(cons, app(app(f, x), y)), app(app(app(app(insert, f), g), z), app(app(g, x), y)))
app(app(max, 0), y) → y
app(app(max, x), 0) → x
app(app(max, app(s, x)), app(s, y)) → app(app(max, x), y)
app(app(min, 0), y) → 0
app(app(min, x), 0) → 0
app(app(min, app(s, x)), app(s, y)) → app(app(min, x), y)
app(asort, z) → app(app(app(sort, min), max), z)
app(dsort, z) → app(app(app(sort, max), min), z)

The set Q consists of the following terms:

app(app(app(sort, x0), x1), nil)
app(app(app(sort, x0), x1), app(app(cons, x2), x3))
app(app(app(app(insert, x0), x1), nil), x2)
app(app(app(app(insert, x0), x1), app(app(cons, x2), x3)), x4)
app(app(max, 0), x0)
app(app(max, x0), 0)
app(app(max, app(s, x0)), app(s, x1))
app(app(min, 0), x0)
app(app(min, x0), 0)
app(app(min, app(s, x0)), app(s, x1))
app(asort, x0)
app(dsort, x0)

We have to consider all minimal (P,Q,R)-chains.
By forward instantiating [14] the rule APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) → APP(f, x) we obtained the following new rules:

APP(app(app(app(insert, app(app(sort, y_0), y_1)), x1), app(app(cons, app(app(cons, y_2), app(app(cons, y_3), y_4))), x3)), x4) → APP(app(app(sort, y_0), y_1), app(app(cons, y_2), app(app(cons, y_3), y_4)))
APP(app(app(app(insert, asort), x1), app(app(cons, x2), x3)), x4) → APP(asort, x2)
APP(app(app(app(insert, dsort), x1), app(app(cons, x2), x3)), x4) → APP(dsort, x2)
APP(app(app(app(insert, app(app(sort, y_0), y_1)), x1), app(app(cons, app(app(cons, y_2), app(app(cons, y_3), app(app(cons, y_4), y_5)))), x3)), x4) → APP(app(app(sort, y_0), y_1), app(app(cons, y_2), app(app(cons, y_3), app(app(cons, y_4), y_5))))
APP(app(app(app(insert, app(app(app(insert, y_0), y_1), app(app(cons, y_2), y_3))), x1), app(app(cons, x2), x3)), x4) → APP(app(app(app(insert, y_0), y_1), app(app(cons, y_2), y_3)), x2)



↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
              ↳ QDP
                ↳ Narrowing
                  ↳ QDP
                    ↳ DependencyGraphProof
                      ↳ QDP
                        ↳ ForwardInstantiation
                          ↳ QDP
                            ↳ ForwardInstantiation
QDP
                                ↳ ForwardInstantiation

Q DP problem:
The TRS P consists of the following rules:

APP(app(app(app(insert, app(app(sort, y_0), y_1)), x1), app(app(cons, app(app(cons, y_2), app(app(cons, y_3), y_4))), x3)), x4) → APP(app(app(sort, y_0), y_1), app(app(cons, y_2), app(app(cons, y_3), y_4)))
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) → APP(g, x)
APP(app(app(app(insert, asort), x1), app(app(cons, x2), x3)), x4) → APP(asort, x2)
APP(app(app(sort, x0), x1), app(app(cons, x2), app(app(cons, y_2), app(app(cons, y_3), y_4)))) → APP(app(app(sort, x0), x1), app(app(cons, y_2), app(app(cons, y_3), y_4)))
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) → APP(app(app(app(insert, f), g), z), app(app(g, x), y))
APP(app(app(sort, x0), x1), app(app(cons, x2), app(app(cons, y_2), y_3))) → APP(app(app(sort, x0), x1), app(app(cons, y_2), y_3))
APP(app(app(app(insert, dsort), x1), app(app(cons, x2), x3)), x4) → APP(dsort, x2)
APP(app(app(app(insert, app(app(sort, y_0), y_1)), x1), app(app(cons, app(app(cons, y_2), app(app(cons, y_3), app(app(cons, y_4), y_5)))), x3)), x4) → APP(app(app(sort, y_0), y_1), app(app(cons, y_2), app(app(cons, y_3), app(app(cons, y_4), y_5))))
APP(asort, z) → APP(app(app(sort, min), max), z)
APP(app(app(sort, x0), x1), app(app(cons, y2), app(app(cons, x2), x3))) → APP(app(app(app(insert, x0), x1), app(app(app(app(insert, x0), x1), app(app(app(sort, x0), x1), x3)), x2)), y2)
APP(dsort, z) → APP(app(app(sort, max), min), z)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) → APP(app(f, x), y)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) → APP(app(g, x), y)
APP(app(app(app(insert, app(app(app(insert, y_0), y_1), app(app(cons, y_2), y_3))), x1), app(app(cons, x2), x3)), x4) → APP(app(app(app(insert, y_0), y_1), app(app(cons, y_2), y_3)), x2)

The TRS R consists of the following rules:

app(app(app(sort, f), g), nil) → nil
app(app(app(sort, f), g), app(app(cons, x), y)) → app(app(app(app(insert, f), g), app(app(app(sort, f), g), y)), x)
app(app(app(app(insert, f), g), nil), y) → app(app(cons, y), nil)
app(app(app(app(insert, f), g), app(app(cons, x), z)), y) → app(app(cons, app(app(f, x), y)), app(app(app(app(insert, f), g), z), app(app(g, x), y)))
app(app(max, 0), y) → y
app(app(max, x), 0) → x
app(app(max, app(s, x)), app(s, y)) → app(app(max, x), y)
app(app(min, 0), y) → 0
app(app(min, x), 0) → 0
app(app(min, app(s, x)), app(s, y)) → app(app(min, x), y)
app(asort, z) → app(app(app(sort, min), max), z)
app(dsort, z) → app(app(app(sort, max), min), z)

The set Q consists of the following terms:

app(app(app(sort, x0), x1), nil)
app(app(app(sort, x0), x1), app(app(cons, x2), x3))
app(app(app(app(insert, x0), x1), nil), x2)
app(app(app(app(insert, x0), x1), app(app(cons, x2), x3)), x4)
app(app(max, 0), x0)
app(app(max, x0), 0)
app(app(max, app(s, x0)), app(s, x1))
app(app(min, 0), x0)
app(app(min, x0), 0)
app(app(min, app(s, x0)), app(s, x1))
app(asort, x0)
app(dsort, x0)

We have to consider all minimal (P,Q,R)-chains.
By forward instantiating [14] the rule APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) → APP(g, x) we obtained the following new rules:

APP(app(app(app(insert, x0), app(app(sort, y_0), y_1)), app(app(cons, app(app(cons, y_2), app(app(cons, y_3), app(app(cons, y_4), y_5)))), x3)), x4) → APP(app(app(sort, y_0), y_1), app(app(cons, y_2), app(app(cons, y_3), app(app(cons, y_4), y_5))))
APP(app(app(app(insert, x0), app(app(app(insert, app(app(app(insert, y_0), y_1), app(app(cons, y_2), y_3))), y_4), app(app(cons, y_5), y_6))), app(app(cons, x2), x3)), x4) → APP(app(app(app(insert, app(app(app(insert, y_0), y_1), app(app(cons, y_2), y_3))), y_4), app(app(cons, y_5), y_6)), x2)
APP(app(app(app(insert, x0), app(app(app(insert, y_0), y_1), app(app(cons, y_2), y_3))), app(app(cons, x2), x3)), x4) → APP(app(app(app(insert, y_0), y_1), app(app(cons, y_2), y_3)), x2)
APP(app(app(app(insert, x0), app(app(sort, y_0), y_1)), app(app(cons, app(app(cons, y_2), app(app(cons, y_3), y_4))), x3)), x4) → APP(app(app(sort, y_0), y_1), app(app(cons, y_2), app(app(cons, y_3), y_4)))
APP(app(app(app(insert, x0), asort), app(app(cons, x2), x3)), x4) → APP(asort, x2)
APP(app(app(app(insert, x0), app(app(app(insert, app(app(sort, y_0), y_1)), y_2), app(app(cons, app(app(cons, y_3), app(app(cons, y_4), y_5))), y_6))), app(app(cons, x2), x3)), x4) → APP(app(app(app(insert, app(app(sort, y_0), y_1)), y_2), app(app(cons, app(app(cons, y_3), app(app(cons, y_4), y_5))), y_6)), x2)
APP(app(app(app(insert, x0), app(app(app(insert, app(app(sort, y_0), y_1)), y_2), app(app(cons, app(app(cons, y_3), app(app(cons, y_4), app(app(cons, y_5), y_6)))), y_7))), app(app(cons, x2), x3)), x4) → APP(app(app(app(insert, app(app(sort, y_0), y_1)), y_2), app(app(cons, app(app(cons, y_3), app(app(cons, y_4), app(app(cons, y_5), y_6)))), y_7)), x2)
APP(app(app(app(insert, x0), dsort), app(app(cons, x2), x3)), x4) → APP(dsort, x2)
APP(app(app(app(insert, x0), app(app(app(insert, dsort), y_0), app(app(cons, y_1), y_2))), app(app(cons, x2), x3)), x4) → APP(app(app(app(insert, dsort), y_0), app(app(cons, y_1), y_2)), x2)
APP(app(app(app(insert, x0), app(app(app(insert, asort), y_0), app(app(cons, y_1), y_2))), app(app(cons, x2), x3)), x4) → APP(app(app(app(insert, asort), y_0), app(app(cons, y_1), y_2)), x2)



↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
              ↳ QDP
                ↳ Narrowing
                  ↳ QDP
                    ↳ DependencyGraphProof
                      ↳ QDP
                        ↳ ForwardInstantiation
                          ↳ QDP
                            ↳ ForwardInstantiation
                              ↳ QDP
                                ↳ ForwardInstantiation
QDP
                                    ↳ ForwardInstantiation

Q DP problem:
The TRS P consists of the following rules:

APP(app(app(app(insert, app(app(sort, y_0), y_1)), x1), app(app(cons, app(app(cons, y_2), app(app(cons, y_3), y_4))), x3)), x4) → APP(app(app(sort, y_0), y_1), app(app(cons, y_2), app(app(cons, y_3), y_4)))
APP(app(app(app(insert, asort), x1), app(app(cons, x2), x3)), x4) → APP(asort, x2)
APP(app(app(app(insert, x0), app(app(sort, y_0), y_1)), app(app(cons, app(app(cons, y_2), app(app(cons, y_3), app(app(cons, y_4), y_5)))), x3)), x4) → APP(app(app(sort, y_0), y_1), app(app(cons, y_2), app(app(cons, y_3), app(app(cons, y_4), y_5))))
APP(app(app(app(insert, x0), app(app(app(insert, y_0), y_1), app(app(cons, y_2), y_3))), app(app(cons, x2), x3)), x4) → APP(app(app(app(insert, y_0), y_1), app(app(cons, y_2), y_3)), x2)
APP(app(app(app(insert, x0), asort), app(app(cons, x2), x3)), x4) → APP(asort, x2)
APP(app(app(sort, x0), x1), app(app(cons, x2), app(app(cons, y_2), app(app(cons, y_3), y_4)))) → APP(app(app(sort, x0), x1), app(app(cons, y_2), app(app(cons, y_3), y_4)))
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) → APP(app(app(app(insert, f), g), z), app(app(g, x), y))
APP(app(app(app(insert, x0), dsort), app(app(cons, x2), x3)), x4) → APP(dsort, x2)
APP(app(app(sort, x0), x1), app(app(cons, x2), app(app(cons, y_2), y_3))) → APP(app(app(sort, x0), x1), app(app(cons, y_2), y_3))
APP(app(app(app(insert, dsort), x1), app(app(cons, x2), x3)), x4) → APP(dsort, x2)
APP(app(app(app(insert, app(app(sort, y_0), y_1)), x1), app(app(cons, app(app(cons, y_2), app(app(cons, y_3), app(app(cons, y_4), y_5)))), x3)), x4) → APP(app(app(sort, y_0), y_1), app(app(cons, y_2), app(app(cons, y_3), app(app(cons, y_4), y_5))))
APP(asort, z) → APP(app(app(sort, min), max), z)
APP(app(app(sort, x0), x1), app(app(cons, y2), app(app(cons, x2), x3))) → APP(app(app(app(insert, x0), x1), app(app(app(app(insert, x0), x1), app(app(app(sort, x0), x1), x3)), x2)), y2)
APP(dsort, z) → APP(app(app(sort, max), min), z)
APP(app(app(app(insert, x0), app(app(app(insert, app(app(app(insert, y_0), y_1), app(app(cons, y_2), y_3))), y_4), app(app(cons, y_5), y_6))), app(app(cons, x2), x3)), x4) → APP(app(app(app(insert, app(app(app(insert, y_0), y_1), app(app(cons, y_2), y_3))), y_4), app(app(cons, y_5), y_6)), x2)
APP(app(app(app(insert, x0), app(app(sort, y_0), y_1)), app(app(cons, app(app(cons, y_2), app(app(cons, y_3), y_4))), x3)), x4) → APP(app(app(sort, y_0), y_1), app(app(cons, y_2), app(app(cons, y_3), y_4)))
APP(app(app(app(insert, x0), app(app(app(insert, app(app(sort, y_0), y_1)), y_2), app(app(cons, app(app(cons, y_3), app(app(cons, y_4), y_5))), y_6))), app(app(cons, x2), x3)), x4) → APP(app(app(app(insert, app(app(sort, y_0), y_1)), y_2), app(app(cons, app(app(cons, y_3), app(app(cons, y_4), y_5))), y_6)), x2)
APP(app(app(app(insert, x0), app(app(app(insert, app(app(sort, y_0), y_1)), y_2), app(app(cons, app(app(cons, y_3), app(app(cons, y_4), app(app(cons, y_5), y_6)))), y_7))), app(app(cons, x2), x3)), x4) → APP(app(app(app(insert, app(app(sort, y_0), y_1)), y_2), app(app(cons, app(app(cons, y_3), app(app(cons, y_4), app(app(cons, y_5), y_6)))), y_7)), x2)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) → APP(app(g, x), y)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) → APP(app(f, x), y)
APP(app(app(app(insert, x0), app(app(app(insert, dsort), y_0), app(app(cons, y_1), y_2))), app(app(cons, x2), x3)), x4) → APP(app(app(app(insert, dsort), y_0), app(app(cons, y_1), y_2)), x2)
APP(app(app(app(insert, x0), app(app(app(insert, asort), y_0), app(app(cons, y_1), y_2))), app(app(cons, x2), x3)), x4) → APP(app(app(app(insert, asort), y_0), app(app(cons, y_1), y_2)), x2)
APP(app(app(app(insert, app(app(app(insert, y_0), y_1), app(app(cons, y_2), y_3))), x1), app(app(cons, x2), x3)), x4) → APP(app(app(app(insert, y_0), y_1), app(app(cons, y_2), y_3)), x2)

The TRS R consists of the following rules:

app(app(app(sort, f), g), nil) → nil
app(app(app(sort, f), g), app(app(cons, x), y)) → app(app(app(app(insert, f), g), app(app(app(sort, f), g), y)), x)
app(app(app(app(insert, f), g), nil), y) → app(app(cons, y), nil)
app(app(app(app(insert, f), g), app(app(cons, x), z)), y) → app(app(cons, app(app(f, x), y)), app(app(app(app(insert, f), g), z), app(app(g, x), y)))
app(app(max, 0), y) → y
app(app(max, x), 0) → x
app(app(max, app(s, x)), app(s, y)) → app(app(max, x), y)
app(app(min, 0), y) → 0
app(app(min, x), 0) → 0
app(app(min, app(s, x)), app(s, y)) → app(app(min, x), y)
app(asort, z) → app(app(app(sort, min), max), z)
app(dsort, z) → app(app(app(sort, max), min), z)

The set Q consists of the following terms:

app(app(app(sort, x0), x1), nil)
app(app(app(sort, x0), x1), app(app(cons, x2), x3))
app(app(app(app(insert, x0), x1), nil), x2)
app(app(app(app(insert, x0), x1), app(app(cons, x2), x3)), x4)
app(app(max, 0), x0)
app(app(max, x0), 0)
app(app(max, app(s, x0)), app(s, x1))
app(app(min, 0), x0)
app(app(min, x0), 0)
app(app(min, app(s, x0)), app(s, x1))
app(asort, x0)
app(dsort, x0)

We have to consider all minimal (P,Q,R)-chains.
By forward instantiating [14] the rule APP(asort, z) → APP(app(app(sort, min), max), z) we obtained the following new rules:

APP(asort, app(app(cons, y_2), app(app(cons, y_3), y_4))) → APP(app(app(sort, min), max), app(app(cons, y_2), app(app(cons, y_3), y_4)))
APP(asort, app(app(cons, y_2), app(app(cons, y_3), app(app(cons, y_4), y_5)))) → APP(app(app(sort, min), max), app(app(cons, y_2), app(app(cons, y_3), app(app(cons, y_4), y_5))))



↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
              ↳ QDP
                ↳ Narrowing
                  ↳ QDP
                    ↳ DependencyGraphProof
                      ↳ QDP
                        ↳ ForwardInstantiation
                          ↳ QDP
                            ↳ ForwardInstantiation
                              ↳ QDP
                                ↳ ForwardInstantiation
                                  ↳ QDP
                                    ↳ ForwardInstantiation
QDP
                                        ↳ ForwardInstantiation

Q DP problem:
The TRS P consists of the following rules:

APP(app(app(sort, x0), x1), app(app(cons, x2), app(app(cons, y_2), app(app(cons, y_3), y_4)))) → APP(app(app(sort, x0), x1), app(app(cons, y_2), app(app(cons, y_3), y_4)))
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) → APP(app(app(app(insert, f), g), z), app(app(g, x), y))
APP(app(app(app(insert, app(app(sort, y_0), y_1)), x1), app(app(cons, app(app(cons, y_2), app(app(cons, y_3), app(app(cons, y_4), y_5)))), x3)), x4) → APP(app(app(sort, y_0), y_1), app(app(cons, y_2), app(app(cons, y_3), app(app(cons, y_4), y_5))))
APP(app(app(sort, x0), x1), app(app(cons, y2), app(app(cons, x2), x3))) → APP(app(app(app(insert, x0), x1), app(app(app(app(insert, x0), x1), app(app(app(sort, x0), x1), x3)), x2)), y2)
APP(app(app(app(insert, x0), app(app(sort, y_0), y_1)), app(app(cons, app(app(cons, y_2), app(app(cons, y_3), y_4))), x3)), x4) → APP(app(app(sort, y_0), y_1), app(app(cons, y_2), app(app(cons, y_3), y_4)))
APP(asort, app(app(cons, y_2), app(app(cons, y_3), app(app(cons, y_4), y_5)))) → APP(app(app(sort, min), max), app(app(cons, y_2), app(app(cons, y_3), app(app(cons, y_4), y_5))))
APP(app(app(app(insert, x0), app(app(app(insert, app(app(sort, y_0), y_1)), y_2), app(app(cons, app(app(cons, y_3), app(app(cons, y_4), y_5))), y_6))), app(app(cons, x2), x3)), x4) → APP(app(app(app(insert, app(app(sort, y_0), y_1)), y_2), app(app(cons, app(app(cons, y_3), app(app(cons, y_4), y_5))), y_6)), x2)
APP(app(app(app(insert, x0), app(app(app(insert, app(app(sort, y_0), y_1)), y_2), app(app(cons, app(app(cons, y_3), app(app(cons, y_4), app(app(cons, y_5), y_6)))), y_7))), app(app(cons, x2), x3)), x4) → APP(app(app(app(insert, app(app(sort, y_0), y_1)), y_2), app(app(cons, app(app(cons, y_3), app(app(cons, y_4), app(app(cons, y_5), y_6)))), y_7)), x2)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) → APP(app(g, x), y)
APP(app(app(app(insert, x0), app(app(app(insert, dsort), y_0), app(app(cons, y_1), y_2))), app(app(cons, x2), x3)), x4) → APP(app(app(app(insert, dsort), y_0), app(app(cons, y_1), y_2)), x2)
APP(app(app(app(insert, app(app(app(insert, y_0), y_1), app(app(cons, y_2), y_3))), x1), app(app(cons, x2), x3)), x4) → APP(app(app(app(insert, y_0), y_1), app(app(cons, y_2), y_3)), x2)
APP(app(app(app(insert, app(app(sort, y_0), y_1)), x1), app(app(cons, app(app(cons, y_2), app(app(cons, y_3), y_4))), x3)), x4) → APP(app(app(sort, y_0), y_1), app(app(cons, y_2), app(app(cons, y_3), y_4)))
APP(app(app(app(insert, asort), x1), app(app(cons, x2), x3)), x4) → APP(asort, x2)
APP(app(app(app(insert, x0), app(app(sort, y_0), y_1)), app(app(cons, app(app(cons, y_2), app(app(cons, y_3), app(app(cons, y_4), y_5)))), x3)), x4) → APP(app(app(sort, y_0), y_1), app(app(cons, y_2), app(app(cons, y_3), app(app(cons, y_4), y_5))))
APP(app(app(app(insert, x0), app(app(app(insert, y_0), y_1), app(app(cons, y_2), y_3))), app(app(cons, x2), x3)), x4) → APP(app(app(app(insert, y_0), y_1), app(app(cons, y_2), y_3)), x2)
APP(app(app(app(insert, x0), asort), app(app(cons, x2), x3)), x4) → APP(asort, x2)
APP(app(app(app(insert, x0), dsort), app(app(cons, x2), x3)), x4) → APP(dsort, x2)
APP(app(app(sort, x0), x1), app(app(cons, x2), app(app(cons, y_2), y_3))) → APP(app(app(sort, x0), x1), app(app(cons, y_2), y_3))
APP(app(app(app(insert, dsort), x1), app(app(cons, x2), x3)), x4) → APP(dsort, x2)
APP(dsort, z) → APP(app(app(sort, max), min), z)
APP(app(app(app(insert, x0), app(app(app(insert, app(app(app(insert, y_0), y_1), app(app(cons, y_2), y_3))), y_4), app(app(cons, y_5), y_6))), app(app(cons, x2), x3)), x4) → APP(app(app(app(insert, app(app(app(insert, y_0), y_1), app(app(cons, y_2), y_3))), y_4), app(app(cons, y_5), y_6)), x2)
APP(asort, app(app(cons, y_2), app(app(cons, y_3), y_4))) → APP(app(app(sort, min), max), app(app(cons, y_2), app(app(cons, y_3), y_4)))
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) → APP(app(f, x), y)
APP(app(app(app(insert, x0), app(app(app(insert, asort), y_0), app(app(cons, y_1), y_2))), app(app(cons, x2), x3)), x4) → APP(app(app(app(insert, asort), y_0), app(app(cons, y_1), y_2)), x2)

The TRS R consists of the following rules:

app(app(app(sort, f), g), nil) → nil
app(app(app(sort, f), g), app(app(cons, x), y)) → app(app(app(app(insert, f), g), app(app(app(sort, f), g), y)), x)
app(app(app(app(insert, f), g), nil), y) → app(app(cons, y), nil)
app(app(app(app(insert, f), g), app(app(cons, x), z)), y) → app(app(cons, app(app(f, x), y)), app(app(app(app(insert, f), g), z), app(app(g, x), y)))
app(app(max, 0), y) → y
app(app(max, x), 0) → x
app(app(max, app(s, x)), app(s, y)) → app(app(max, x), y)
app(app(min, 0), y) → 0
app(app(min, x), 0) → 0
app(app(min, app(s, x)), app(s, y)) → app(app(min, x), y)
app(asort, z) → app(app(app(sort, min), max), z)
app(dsort, z) → app(app(app(sort, max), min), z)

The set Q consists of the following terms:

app(app(app(sort, x0), x1), nil)
app(app(app(sort, x0), x1), app(app(cons, x2), x3))
app(app(app(app(insert, x0), x1), nil), x2)
app(app(app(app(insert, x0), x1), app(app(cons, x2), x3)), x4)
app(app(max, 0), x0)
app(app(max, x0), 0)
app(app(max, app(s, x0)), app(s, x1))
app(app(min, 0), x0)
app(app(min, x0), 0)
app(app(min, app(s, x0)), app(s, x1))
app(asort, x0)
app(dsort, x0)

We have to consider all minimal (P,Q,R)-chains.
By forward instantiating [14] the rule APP(dsort, z) → APP(app(app(sort, max), min), z) we obtained the following new rules:

APP(dsort, app(app(cons, y_2), app(app(cons, y_3), y_4))) → APP(app(app(sort, max), min), app(app(cons, y_2), app(app(cons, y_3), y_4)))
APP(dsort, app(app(cons, y_2), app(app(cons, y_3), app(app(cons, y_4), y_5)))) → APP(app(app(sort, max), min), app(app(cons, y_2), app(app(cons, y_3), app(app(cons, y_4), y_5))))



↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
              ↳ QDP
                ↳ Narrowing
                  ↳ QDP
                    ↳ DependencyGraphProof
                      ↳ QDP
                        ↳ ForwardInstantiation
                          ↳ QDP
                            ↳ ForwardInstantiation
                              ↳ QDP
                                ↳ ForwardInstantiation
                                  ↳ QDP
                                    ↳ ForwardInstantiation
                                      ↳ QDP
                                        ↳ ForwardInstantiation
QDP
                                            ↳ MNOCProof

Q DP problem:
The TRS P consists of the following rules:

APP(app(app(sort, x0), x1), app(app(cons, x2), app(app(cons, y_2), app(app(cons, y_3), y_4)))) → APP(app(app(sort, x0), x1), app(app(cons, y_2), app(app(cons, y_3), y_4)))
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) → APP(app(app(app(insert, f), g), z), app(app(g, x), y))
APP(dsort, app(app(cons, y_2), app(app(cons, y_3), y_4))) → APP(app(app(sort, max), min), app(app(cons, y_2), app(app(cons, y_3), y_4)))
APP(app(app(app(insert, app(app(sort, y_0), y_1)), x1), app(app(cons, app(app(cons, y_2), app(app(cons, y_3), app(app(cons, y_4), y_5)))), x3)), x4) → APP(app(app(sort, y_0), y_1), app(app(cons, y_2), app(app(cons, y_3), app(app(cons, y_4), y_5))))
APP(app(app(sort, x0), x1), app(app(cons, y2), app(app(cons, x2), x3))) → APP(app(app(app(insert, x0), x1), app(app(app(app(insert, x0), x1), app(app(app(sort, x0), x1), x3)), x2)), y2)
APP(app(app(app(insert, x0), app(app(sort, y_0), y_1)), app(app(cons, app(app(cons, y_2), app(app(cons, y_3), y_4))), x3)), x4) → APP(app(app(sort, y_0), y_1), app(app(cons, y_2), app(app(cons, y_3), y_4)))
APP(asort, app(app(cons, y_2), app(app(cons, y_3), app(app(cons, y_4), y_5)))) → APP(app(app(sort, min), max), app(app(cons, y_2), app(app(cons, y_3), app(app(cons, y_4), y_5))))
APP(app(app(app(insert, x0), app(app(app(insert, app(app(sort, y_0), y_1)), y_2), app(app(cons, app(app(cons, y_3), app(app(cons, y_4), y_5))), y_6))), app(app(cons, x2), x3)), x4) → APP(app(app(app(insert, app(app(sort, y_0), y_1)), y_2), app(app(cons, app(app(cons, y_3), app(app(cons, y_4), y_5))), y_6)), x2)
APP(app(app(app(insert, x0), app(app(app(insert, app(app(sort, y_0), y_1)), y_2), app(app(cons, app(app(cons, y_3), app(app(cons, y_4), app(app(cons, y_5), y_6)))), y_7))), app(app(cons, x2), x3)), x4) → APP(app(app(app(insert, app(app(sort, y_0), y_1)), y_2), app(app(cons, app(app(cons, y_3), app(app(cons, y_4), app(app(cons, y_5), y_6)))), y_7)), x2)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) → APP(app(g, x), y)
APP(app(app(app(insert, x0), app(app(app(insert, dsort), y_0), app(app(cons, y_1), y_2))), app(app(cons, x2), x3)), x4) → APP(app(app(app(insert, dsort), y_0), app(app(cons, y_1), y_2)), x2)
APP(app(app(app(insert, app(app(app(insert, y_0), y_1), app(app(cons, y_2), y_3))), x1), app(app(cons, x2), x3)), x4) → APP(app(app(app(insert, y_0), y_1), app(app(cons, y_2), y_3)), x2)
APP(app(app(app(insert, app(app(sort, y_0), y_1)), x1), app(app(cons, app(app(cons, y_2), app(app(cons, y_3), y_4))), x3)), x4) → APP(app(app(sort, y_0), y_1), app(app(cons, y_2), app(app(cons, y_3), y_4)))
APP(app(app(app(insert, asort), x1), app(app(cons, x2), x3)), x4) → APP(asort, x2)
APP(app(app(app(insert, x0), app(app(sort, y_0), y_1)), app(app(cons, app(app(cons, y_2), app(app(cons, y_3), app(app(cons, y_4), y_5)))), x3)), x4) → APP(app(app(sort, y_0), y_1), app(app(cons, y_2), app(app(cons, y_3), app(app(cons, y_4), y_5))))
APP(app(app(app(insert, x0), app(app(app(insert, y_0), y_1), app(app(cons, y_2), y_3))), app(app(cons, x2), x3)), x4) → APP(app(app(app(insert, y_0), y_1), app(app(cons, y_2), y_3)), x2)
APP(app(app(app(insert, x0), asort), app(app(cons, x2), x3)), x4) → APP(asort, x2)
APP(app(app(sort, x0), x1), app(app(cons, x2), app(app(cons, y_2), y_3))) → APP(app(app(sort, x0), x1), app(app(cons, y_2), y_3))
APP(app(app(app(insert, x0), dsort), app(app(cons, x2), x3)), x4) → APP(dsort, x2)
APP(app(app(app(insert, dsort), x1), app(app(cons, x2), x3)), x4) → APP(dsort, x2)
APP(asort, app(app(cons, y_2), app(app(cons, y_3), y_4))) → APP(app(app(sort, min), max), app(app(cons, y_2), app(app(cons, y_3), y_4)))
APP(app(app(app(insert, x0), app(app(app(insert, app(app(app(insert, y_0), y_1), app(app(cons, y_2), y_3))), y_4), app(app(cons, y_5), y_6))), app(app(cons, x2), x3)), x4) → APP(app(app(app(insert, app(app(app(insert, y_0), y_1), app(app(cons, y_2), y_3))), y_4), app(app(cons, y_5), y_6)), x2)
APP(dsort, app(app(cons, y_2), app(app(cons, y_3), app(app(cons, y_4), y_5)))) → APP(app(app(sort, max), min), app(app(cons, y_2), app(app(cons, y_3), app(app(cons, y_4), y_5))))
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) → APP(app(f, x), y)
APP(app(app(app(insert, x0), app(app(app(insert, asort), y_0), app(app(cons, y_1), y_2))), app(app(cons, x2), x3)), x4) → APP(app(app(app(insert, asort), y_0), app(app(cons, y_1), y_2)), x2)

The TRS R consists of the following rules:

app(app(app(sort, f), g), nil) → nil
app(app(app(sort, f), g), app(app(cons, x), y)) → app(app(app(app(insert, f), g), app(app(app(sort, f), g), y)), x)
app(app(app(app(insert, f), g), nil), y) → app(app(cons, y), nil)
app(app(app(app(insert, f), g), app(app(cons, x), z)), y) → app(app(cons, app(app(f, x), y)), app(app(app(app(insert, f), g), z), app(app(g, x), y)))
app(app(max, 0), y) → y
app(app(max, x), 0) → x
app(app(max, app(s, x)), app(s, y)) → app(app(max, x), y)
app(app(min, 0), y) → 0
app(app(min, x), 0) → 0
app(app(min, app(s, x)), app(s, y)) → app(app(min, x), y)
app(asort, z) → app(app(app(sort, min), max), z)
app(dsort, z) → app(app(app(sort, max), min), z)

The set Q consists of the following terms:

app(app(app(sort, x0), x1), nil)
app(app(app(sort, x0), x1), app(app(cons, x2), x3))
app(app(app(app(insert, x0), x1), nil), x2)
app(app(app(app(insert, x0), x1), app(app(cons, x2), x3)), x4)
app(app(max, 0), x0)
app(app(max, x0), 0)
app(app(max, app(s, x0)), app(s, x1))
app(app(min, 0), x0)
app(app(min, x0), 0)
app(app(min, app(s, x0)), app(s, x1))
app(asort, x0)
app(dsort, x0)

We have to consider all minimal (P,Q,R)-chains.
We use the modular non-overlap check [17] to decrease Q to the empty set.

↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
              ↳ QDP
                ↳ Narrowing
                  ↳ QDP
                    ↳ DependencyGraphProof
                      ↳ QDP
                        ↳ ForwardInstantiation
                          ↳ QDP
                            ↳ ForwardInstantiation
                              ↳ QDP
                                ↳ ForwardInstantiation
                                  ↳ QDP
                                    ↳ ForwardInstantiation
                                      ↳ QDP
                                        ↳ ForwardInstantiation
                                          ↳ QDP
                                            ↳ MNOCProof
QDP

Q DP problem:
The TRS P consists of the following rules:

APP(app(app(sort, x0), x1), app(app(cons, x2), app(app(cons, y_2), app(app(cons, y_3), y_4)))) → APP(app(app(sort, x0), x1), app(app(cons, y_2), app(app(cons, y_3), y_4)))
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) → APP(app(app(app(insert, f), g), z), app(app(g, x), y))
APP(dsort, app(app(cons, y_2), app(app(cons, y_3), y_4))) → APP(app(app(sort, max), min), app(app(cons, y_2), app(app(cons, y_3), y_4)))
APP(app(app(app(insert, app(app(sort, y_0), y_1)), x1), app(app(cons, app(app(cons, y_2), app(app(cons, y_3), app(app(cons, y_4), y_5)))), x3)), x4) → APP(app(app(sort, y_0), y_1), app(app(cons, y_2), app(app(cons, y_3), app(app(cons, y_4), y_5))))
APP(app(app(sort, x0), x1), app(app(cons, y2), app(app(cons, x2), x3))) → APP(app(app(app(insert, x0), x1), app(app(app(app(insert, x0), x1), app(app(app(sort, x0), x1), x3)), x2)), y2)
APP(app(app(app(insert, x0), app(app(sort, y_0), y_1)), app(app(cons, app(app(cons, y_2), app(app(cons, y_3), y_4))), x3)), x4) → APP(app(app(sort, y_0), y_1), app(app(cons, y_2), app(app(cons, y_3), y_4)))
APP(asort, app(app(cons, y_2), app(app(cons, y_3), app(app(cons, y_4), y_5)))) → APP(app(app(sort, min), max), app(app(cons, y_2), app(app(cons, y_3), app(app(cons, y_4), y_5))))
APP(app(app(app(insert, x0), app(app(app(insert, app(app(sort, y_0), y_1)), y_2), app(app(cons, app(app(cons, y_3), app(app(cons, y_4), y_5))), y_6))), app(app(cons, x2), x3)), x4) → APP(app(app(app(insert, app(app(sort, y_0), y_1)), y_2), app(app(cons, app(app(cons, y_3), app(app(cons, y_4), y_5))), y_6)), x2)
APP(app(app(app(insert, x0), app(app(app(insert, app(app(sort, y_0), y_1)), y_2), app(app(cons, app(app(cons, y_3), app(app(cons, y_4), app(app(cons, y_5), y_6)))), y_7))), app(app(cons, x2), x3)), x4) → APP(app(app(app(insert, app(app(sort, y_0), y_1)), y_2), app(app(cons, app(app(cons, y_3), app(app(cons, y_4), app(app(cons, y_5), y_6)))), y_7)), x2)
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) → APP(app(g, x), y)
APP(app(app(app(insert, x0), app(app(app(insert, dsort), y_0), app(app(cons, y_1), y_2))), app(app(cons, x2), x3)), x4) → APP(app(app(app(insert, dsort), y_0), app(app(cons, y_1), y_2)), x2)
APP(app(app(app(insert, app(app(app(insert, y_0), y_1), app(app(cons, y_2), y_3))), x1), app(app(cons, x2), x3)), x4) → APP(app(app(app(insert, y_0), y_1), app(app(cons, y_2), y_3)), x2)
APP(app(app(app(insert, app(app(sort, y_0), y_1)), x1), app(app(cons, app(app(cons, y_2), app(app(cons, y_3), y_4))), x3)), x4) → APP(app(app(sort, y_0), y_1), app(app(cons, y_2), app(app(cons, y_3), y_4)))
APP(app(app(app(insert, asort), x1), app(app(cons, x2), x3)), x4) → APP(asort, x2)
APP(app(app(app(insert, x0), app(app(sort, y_0), y_1)), app(app(cons, app(app(cons, y_2), app(app(cons, y_3), app(app(cons, y_4), y_5)))), x3)), x4) → APP(app(app(sort, y_0), y_1), app(app(cons, y_2), app(app(cons, y_3), app(app(cons, y_4), y_5))))
APP(app(app(app(insert, x0), app(app(app(insert, y_0), y_1), app(app(cons, y_2), y_3))), app(app(cons, x2), x3)), x4) → APP(app(app(app(insert, y_0), y_1), app(app(cons, y_2), y_3)), x2)
APP(app(app(app(insert, x0), asort), app(app(cons, x2), x3)), x4) → APP(asort, x2)
APP(app(app(sort, x0), x1), app(app(cons, x2), app(app(cons, y_2), y_3))) → APP(app(app(sort, x0), x1), app(app(cons, y_2), y_3))
APP(app(app(app(insert, x0), dsort), app(app(cons, x2), x3)), x4) → APP(dsort, x2)
APP(app(app(app(insert, dsort), x1), app(app(cons, x2), x3)), x4) → APP(dsort, x2)
APP(asort, app(app(cons, y_2), app(app(cons, y_3), y_4))) → APP(app(app(sort, min), max), app(app(cons, y_2), app(app(cons, y_3), y_4)))
APP(app(app(app(insert, x0), app(app(app(insert, app(app(app(insert, y_0), y_1), app(app(cons, y_2), y_3))), y_4), app(app(cons, y_5), y_6))), app(app(cons, x2), x3)), x4) → APP(app(app(app(insert, app(app(app(insert, y_0), y_1), app(app(cons, y_2), y_3))), y_4), app(app(cons, y_5), y_6)), x2)
APP(dsort, app(app(cons, y_2), app(app(cons, y_3), app(app(cons, y_4), y_5)))) → APP(app(app(sort, max), min), app(app(cons, y_2), app(app(cons, y_3), app(app(cons, y_4), y_5))))
APP(app(app(app(insert, f), g), app(app(cons, x), z)), y) → APP(app(f, x), y)
APP(app(app(app(insert, x0), app(app(app(insert, asort), y_0), app(app(cons, y_1), y_2))), app(app(cons, x2), x3)), x4) → APP(app(app(app(insert, asort), y_0), app(app(cons, y_1), y_2)), x2)

The TRS R consists of the following rules:

app(app(app(sort, f), g), nil) → nil
app(app(app(sort, f), g), app(app(cons, x), y)) → app(app(app(app(insert, f), g), app(app(app(sort, f), g), y)), x)
app(app(app(app(insert, f), g), nil), y) → app(app(cons, y), nil)
app(app(app(app(insert, f), g), app(app(cons, x), z)), y) → app(app(cons, app(app(f, x), y)), app(app(app(app(insert, f), g), z), app(app(g, x), y)))
app(app(max, 0), y) → y
app(app(max, x), 0) → x
app(app(max, app(s, x)), app(s, y)) → app(app(max, x), y)
app(app(min, 0), y) → 0
app(app(min, x), 0) → 0
app(app(min, app(s, x)), app(s, y)) → app(app(min, x), y)
app(asort, z) → app(app(app(sort, min), max), z)
app(dsort, z) → app(app(app(sort, max), min), z)

Q is empty.
We have to consider all (P,Q,R)-chains.